<%@page import="java.util.Iterator"%>
<%@page import="cn.com.entity.Pexamination"%>
<%@page import="java.util.Set"%>
<%@page import="cn.com.dao.PexaminationPackageDao"%>
<%@page import="cn.com.entity.PexaminationPackage"%>
<%@page import="cn.com.dao.ConsumerDao"%>
<%@page import="cn.com.entity.Consumer"%>
<%@page import="java.util.List"%>
<%@page import="cn.com.entity.PexaminationForm"%>
<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@taglib prefix="c"  uri="http://java.sun.com/jsp/jstl/core"%>  
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Insert title here</title>
</head>
<body>
<h4 align="center">${pexaminationformmsg}</h4>
<%
if(session.getAttribute("pexaminationform")!=null){
	PexaminationForm pf=(PexaminationForm)session.getAttribute("pexaminationform");
	int  consumerid=pf.getConsumerid();
	int  pexaminationpackageid=pf.getPexaminationpackageid();
	//通过用户id获得一个用户对象
	Consumer c=new Consumer();
	c.setConsumerid(consumerid);
	ConsumerDao cd=new ConsumerDao();
	Consumer consumer=cd.selectOneConsumer(c);
	//通过套餐id获取一个套餐对象
	PexaminationPackage pp=new PexaminationPackage();
	pp.setPexaminationpackageid(pexaminationpackageid);
	PexaminationPackageDao ppd=new PexaminationPackageDao();
	PexaminationPackage pexaminationPackage=ppd.selectPexaminationPackageByid(pp);

	String status="已体检";
	if(pf.getPexaminationstatus()==0){
		status="未体检";
	}
	
	
%>
<h2 align="center">体检单详情</h2>
<table border="1" width="60%" align="center">
	<tr>
		<td>姓名：<%=consumer.getRealname() %></td>
		<td>性别：<%=consumer.getConsumersex() %></td>
		<td>年龄：<%=consumer.getConsumerage() %></td>
		<td>联系方式：<%=consumer.getConsumerphone() %></td>
	</tr>
	
	<tr><td>体检套餐为：<%=pexaminationPackage.getPexaminationpackagename() %></td></tr>
	
	<tr>
		<td>体检类别名</td>
		<td>体检结果</td>
	</tr>
<%
	Set<Pexamination> pexset=pexaminationPackage.getPexaminationset();
	Iterator<Pexamination> it=pexset.iterator();
	while(it.hasNext()){
		Pexamination p=it.next();
%>
	<tr>
		<td><%=p.getPexaminationname() %></td>
		<td><%=p.getPexaminationresult() %></td>
	</tr>
<%} %>	
	<tr>
		<td>医生建议:<%=pf.getPexaminationadvice() %></td>
		
	</tr>
	
	<tr>
		<td>体检状态:<%=status %></td>
		<td>体检套餐费用:<%=pexaminationPackage.getPrice() %></td>
	</tr>
</table>
<%} %>

</body>
</html>